﻿using DKPScoreWebApi.DTOs.Requests;
using DKPScoreWebApi.Models;

namespace DKPScoreWebApi.Services.Interfaces
{
    /// <summary>
    /// 成员管理服务接口
    /// 定义工会成员相关的业务逻辑操作
    /// </summary>
    public interface IMemberService
    {
        /// <summary>
        /// 添加工会成员
        /// </summary>
        /// <param name="guildId">工会ID</param>
        /// <param name="request">添加成员请求数据</param>
        /// <returns>创建的成员实体</returns>
        Task<GuildMember> AddGuildMemberAsync(int guildId, AddMemberRequest request);

        /// <summary>
        /// 获取工会成员列表
        /// </summary>
        /// <param name="guildId">工会ID</param>
        /// <param name="activeOnly">是否只返回活跃成员，默认为true</param>
        /// <returns>成员列表</returns>
        Task<List<GuildMember>> GetGuildMembersAsync(int guildId, bool activeOnly = true);

        /// <summary>
        /// 根据ID获取成员详情
        /// </summary>
        /// <param name="memberId">成员ID</param>
        /// <returns>成员实体</returns>
        Task<GuildMember> GetMemberByIdAsync(int memberId);

        /// <summary>
        /// 更新成员信息
        /// </summary>
        /// <param name="memberId">成员ID</param>
        /// <param name="request">更新请求数据</param>
        /// <returns>true表示更新成功，false表示失败</returns>
        Task<bool> UpdateMemberAsync(int memberId, AddMemberRequest request);

        /// <summary>
        /// 移除工会成员（软删除）
        /// </summary>
        /// <param name="guildId">工会ID</param>
        /// <param name="memberId">成员ID</param>
        /// <returns>true表示移除成功，false表示失败</returns>
        Task<bool> RemoveGuildMemberAsync(int guildId, int memberId);

        /// <summary>
        /// 恢复已移除的工会成员
        /// </summary>
        /// <param name="guildId">工会ID</param>
        /// <param name="memberId">成员ID</param>
        /// <returns>true表示恢复成功，false表示失败</returns>
        Task<bool> RestoreGuildMemberAsync(int guildId, int memberId);

        /// <summary>
        /// 搜索工会成员
        /// </summary>
        /// <param name="guildId">工会ID</param>
        /// <param name="searchTerm">搜索关键词</param>
        /// <returns>匹配的成员列表</returns>
        Task<List<GuildMember>> SearchMembersAsync(int guildId, string searchTerm);
    }
}
